﻿namespace HelenServer.Core;

public class OperationUser
{
    protected OperationUser(OperationUser user)
        : this(user.Id, user.Username, user.Roles, user.IsAuthenticated)
    {

    }

    public OperationUser(string id, string name, IEnumerable<string> roles, bool isAuthenticated)
    {
        Id = id;

        Username = name;

        Roles = roles.ToArray();

        IsAuthenticated = isAuthenticated;
    }

    public static OperationUser None
        => new(string.Empty, string.Empty, Array.Empty<string>(), false);

    public bool IsAuthenticated { get; }

    public string Id { get; }

    public string Username { get; }

    public string[] Roles { get; }
}